package cn.bxshey.modules_commodity.mapper;

import cn.bxshey.modules_commodity.dto.commodity.*;
import cn.bxshey.modules_commodity.vo.commodity.CartDetailVO;
import cn.bxshey.modules_commodity.vo.commodity.DetailVO;
import cn.bxshey.modules_commodity.vo.commodity.PaginatedQueriesVO;
import cn.bxshey.modules_commodity.vo.commodity.SettlementSpecificationVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @作者：不想说话而已
 * @Date：2024/1/30 14:40
 */

@Mapper
public interface CommodityMapper {

    //分页获取商品信息
    List<PaginatedQueriesVO> queryPage(PaginatedQueriesDTO dto);

    //新增商品
    Integer addCommodity(@Param("commodityId") String commodityId,@Param("dto") AddCommodityDTO dto);

    //新增商品规格
    Integer addCommoditySpecification(AddCommoditySpecificationDTO dto);

    //更新商品(不更新规格)
    Integer updateCommodity(UpdateCommodityDTO dto);

    //更新商品规格
    Integer updateCommoditySpecification(UpdateCommoditySpecificationDto dto);

    //商品详情
    DetailVO commodityById(String id);

    //批量查询商品
    List<CartDetailVO> commodityList(@Param("idList") List<String> idList);

    //批量查询商品规格
    List<SettlementSpecificationVO> commoditySpecificationList(@Param("idList") List<SettlementDTO> idList);
}
